export const joinRoom = (roomId: string) => {
  console.log(roomId);
};



export const transformMode = (mode: 'light' | 'dark') => {
  if (mode === 'light') {
    document.documentElement.removeAttribute("theme-mode");
    return;
  }
  document.documentElement.setAttribute('theme-mode', mode);
}


export function setSharedRoomInfo(rooms:any[]) {
  localStorage.setItem("sharedRoomInfo", JSON.stringify(rooms));
  // 手动触发一次
  window.dispatchEvent(new StorageEvent("storage", {
    key: "sharedRoomInfo",
    newValue: JSON.stringify(rooms),
  }));
}
